# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: stef <l0ls0fo2i@ctrlc.hu>
# Contributor: Eivind Uggedal <eu@eju.no>
# Contributor: Nico Schottelius <nico.schottelius@ungleich.ch>
# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=mu
pkgver=1.12.5
pkgrel=0
pkgdesc="A collection of utilities for indexing and searching Maildirs"
url="https://www.djcbsoftware.nl/code/mu/"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	emacs-nox
	glib-dev
	gmime-dev
	meson
	readline-dev
	texinfo
	xapian-core-dev
	"
subpackages="$pkgname-doc mu4e::noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/djcb/mu/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare

	abuild-meson \
		-Dguile=disabled \
		-Dreadline=enabled \
		build
}

build() {
	ninja -C build
}

check() {
	meson test --no-rebuild --print-errorlogs -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

mu4e() {
	pkgdesc="Emacs-based e-mail client which uses mu as its back-end"
	depends="$pkgname=$pkgver-r$pkgrel cmd:emacs"

	amove usr/share/emacs
}

sha512sums="
2a879f0ebb955729f3ba5c30615df3752d0d3a5909647bf98f05e666c71fb74beeb2ecdd7f86db93f6739befdeca2b67cb7d4d1e6e2bd35028191a7ac86b435e  mu-1.12.5.tar.gz
"
